package com.example.emqx.controller;

import com.example.emqx.entity.ApiResponse;
import com.example.emqx.entity.RedisUser;
import com.example.emqx.service.RedisUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class RedisUserController {

    @Autowired
    private RedisUserService redisUserService;

    @GetMapping("/redisUserList")
    public ApiResponse<List<RedisUser>> getRedisUserList() {
        List<RedisUser> list = redisUserService.list();
        return ApiResponse.success(list);
    }
}
